<template>
  <div>
    <div class="son">
      <ul v-for="(i,index) in classList" :key="index" @click=godetail(i.articleId)>
        <li><img :src="i.bannerImgUrl"></li>
        <li>{{ i.title }}</li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  name: "ArticleSon",
  props: {
    classList: [Array, String]
  },
  created() {
    console.log(this.classList)
  },
  methods:{
    godetail(e){
      console.log(e)
      this.$router.push({
        path:"/ArticleDetail",
        query:{
          articleId:e
        }
      })
    }
  }
}
</script>

<style scoped lang="less">
.son {
  width: 1200px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  //align-items: center;

  ul {
    width: 220px;
    //height: 200px;
    list-style: none;
    padding: 0;
    margin-top: 20px;
    margin-right: 20px;

    li:nth-of-type(2) {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    li:nth-of-type(3) {
      color: #888888;
    }

    li:nth-of-type(1) {
      width: 220px;
      height: 120px;
      overflow: hidden;

      img {
        width: 220px;
        height: 120px;
        transition: transform 0.5s ease;
      }

      img:hover {
        transform: scale(1.1);
      }

    }

    span:nth-of-type(1) {
      color: #ff4500;
      font-weight: bold;
    }

    span:nth-of-type(2) {
      font-size: 12px;
      color: #999999;
      text-decoration: line-through;
    }
  }
}

ul:hover {
  li:nth-of-type(2) {
    color: #178265;
  }
}

</style>